import { resolve } from 'path'
import { config } from 'dotenv'

const appPath = process.cwd()
const resloveApp = (reslovePath: string) => resolve(appPath, reslovePath)
const dotEnv = resloveApp('.env')

export default (env: 'dev' | 'prod' | 'test' | 'qa') => {
  config({ path: `${dotEnv}.${env}.local` })
  config({ path: `${dotEnv}.${env}` })
  config({ path: dotEnv })
  console.log('当前环境', env)
}
